package mall.controller;

import javax.servlet.ServletContext;

import mall.util.UtilityClass;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class WebStaticController {
	
	@Autowired
	ServletContext servletContext;
	
	@RequestMapping(value = "/about", method = RequestMethod.GET)
	public String aboutStatic() {
		return UtilityClass.VIEW_MALL_STATIC_ABOUT;
	}

	@RequestMapping(value = "/contact", method = RequestMethod.GET)
	public String contactStatic() {
		return UtilityClass.VIEW_MALL_STATIC_CONTACT;
	}

	@RequestMapping(value = "/blog", method = RequestMethod.GET)
	public String blogStatic() {
		return UtilityClass.VIEW_MALL_STATIC_BLOG;
	}
	
	@RequestMapping(value = "/sale", method = RequestMethod.GET)
	public String saleStatic() {
		return UtilityClass.VIEW_MALL_STATIC_SALE;
	}

	@RequestMapping(value = "/index", method = RequestMethod.GET)
	public ModelAndView indexStatic() {
		System.out.println(servletContext.getRealPath("WEB-INF"));
		return new ModelAndView(UtilityClass.VIEW_MALL_INDEX);
	}
	
	@RequestMapping(value="/about-shop",method=RequestMethod.GET)
	public String aboutShopStatic(){
		return UtilityClass.VIEW_SHOP_STATIC_ABOUT;
	}
	@RequestMapping(value="/delivery-shop",method=RequestMethod.GET)
	public String deliveryShopStatic(){
		return UtilityClass.VIEW_SHOP_STATIC_DELIVERY;
	}
	@RequestMapping(value="/news-shop",method=RequestMethod.GET)
	public String newsShopStatic(){
		return UtilityClass.VIEW_SHOP_STATIC_NEWS;
	}
	@RequestMapping(value="/contact-shop",method=RequestMethod.GET)
	public String contactShopStatic(){
		return UtilityClass.VIEW_SHOP_STATIC_CONTACT;
	}
	
}
